home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
dev
/
gui
/
gengui2.lha
/
GenGui2
/
Examples
/
backfillhook.h
next >
Wrap
C/C++ Source or Header
|
1995-02-08
|
1KB
|
45 lines
#ifndef BACKFILLHOOK
#define BACKFILLHOOK
#include <graphics/gfxmacros.h>
struct LMsg {
struct Layer *Layer;
WORD MinX,MinY; /* Coordinates in the screen */
WORD MaxX,MaxY;
LONG OffsetX,OffsetY; /* Coordinates in the window */
};
ULONG __interrupt __saveds __asm HookFunc(register __a0 struct Hook *hook,
register __a2 struct RastPort *rastport,
register __a1 struct LMsg *msg)
{
struct RastPort rp=*rastport;
ULONG color;
static __chip USHORT bitmap[]={0xaaaa,0x5555,0xaaaa};
rp.Layer=NULL;
color=(ULONG)hook->h_Data;
SetAPen(&rp,color>>16);
SetBPen(&rp,color&0xffff);
SetDrMd(&rp,JAM2);
/* Adjust the pattern to the window position */
if((msg->MinX ^ msg->MinY ^ msg->OffsetX ^ msg->OffsetY) & 1)
{SetAfPt(&rp,(bitmap+1),1);} else
{SetAfPt(&rp,bitmap,1);}
RectFill(&rp,msg->MinX,msg->MinY,msg->MaxX,msg->MaxY);
return(0);
}
#define COLOR(a,b) (void *)(((a)<<16)|b)
#endif